package com.qfmy.webapp.controller.wallpaper;

import com.qfmy.common.result.Result;
import com.qfmy.model.vo.wallpaper.EmojiVo;
import com.qfmy.webapp.service.wallpaper.EmojiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.controller.wallpaper
 * @date 2025/11/26
 * @description 表情包
 */
@RestController
@SuppressWarnings("all")
@RequestMapping("/app/emojin")
public class EmojiController {

    /**
     * 注入service
     */
    @Autowired
    private EmojiService emojiService;

    /**
     * 获取精选表情
     */
    @RequestMapping("/getJingXuanEmojis")
    public Result<List<EmojiVo>> getJingXuanEmojis() {
        List<EmojiVo> list = emojiService.getJingXuanEmojis();
        return Result.ok(list);
    }

    /**
     * 根据表情id更新下载次数
     */
    @RequestMapping("/updateDownloadCountEmoji")
    public Result<Void> updateDownloadCount(@RequestParam Integer id) {
        emojiService.updateDownloadCount(id);
        return Result.ok();
    }


}
